package optimization;

import java.text.SimpleDateFormat;
import java.util.Date;

public class OldLogger {
	
	static StringBuffer sb = new StringBuffer();
	static SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ");
	
	public static void log(String message) {
		sb.append(df.format(new Date()) + "  " + message+"\n");
		System.out.println(">> " + df.format(new Date()) + "  " + message);
	}

	public static void format(String format, Object... params) {
		sb.append(df.format(new Date()) + "  " + String.format(format+"\n", params));
		System.out.format(">> " + df.format(new Date()) + "  " + format + "\n", params);
	}
	
	public static String getLog() {
		return sb.toString();
	}
}
